Skip to content

Conversation

@RaidAndFade
Copy link

Closes: No issue found regarding this fix

What's Changed

Added an if statement in the peerendpointaddressfamily_retrieve.html jinja view template to check if routing instance is defined and not "", preventing url not found errors from occurring on page load.

ONLY /nautobot_bgp_models/templates/nautobot_bgp_models/peerendpointaddressfamily_retrieve.html was modified. No python code or major changes made. very quick fix. Might not be your desired solution but it worked in my environment.

To Do

  • Explanation of Change(s)
  • Added change log fragment(s) (for more information see the documentation)

The above link is incorrect in your template ^
I imagine you intended to link to https://docs.nautobot.com/projects/core/en/stable/development/core/#creating-changelog-fragments

<tr>
<td>Routing Instance</td>
<td><a href="{% url 'plugins:nautobot_bgp_models:bgproutinginstance' pk=object.peer_endpoint.routing_instance.pk %}">{{ object.peer_endpoint.routing_instance }}</a></td>
{% if object.peer_endpoint.routing_instance and object.peer_endpoint.routing_instance != '' %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the first check should be sufficient here.

Copy link
Author

@RaidAndFade RaidAndFade May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was not in my testing, since the model is defined and set as "" apparently?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was not in my testing, since the model is defined and set as "" apparently?

That points to instance of BGPRoutingInstance, so should be either instance of BGPRoutingInstance or None on PeerEndpoint model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants